home *** CD-ROM | disk | FTP | other *** search
- program CClient;
- {$DEFINE CALLBACK}
- {$APPTYPE CONSOLE}
- uses
- SysUtils,
- CORBA,
- DrBob42_c in 'DrBob42_c.pas',
- DrBob42_i in 'DrBob42_i.pas',
- DrBob42_s, Rates_impl;
-
- var
- Rate: Rates; // skeleton object
- Account: Accounts; // skeleton object
-
- procedure AccountArrayTest;
- var
- MyAccounts: AccountArray;
- begin
- MyAccounts[0] := TNormalOrSavingAccount.Create;
- MyAccounts[0].accountN := TNormalAccount.Create(7); // normal
- MyAccounts[1] := TNormalOrSavingAccount.Create;
- MyAccounts[1].accountN := TNormalAccount.Create(42); // normal
- MyAccounts[2] := TNormalOrSavingAccount.Create;
- MyAccounts[2].accountS := TSavingAccount.Create(42,Rate); // saving
- Account.AccountArrayTest(MyAccounts);
- end;
-
- procedure AccountSequenceTest;
- var
- MyAccounts: AccountSequence;
- begin
- SetLength(MyAccounts,2);
- MyAccounts[0] := TNormalOrSavingAccount.Create;
- MyAccounts[0].accountN := TNormalAccount.Create(7); // normal
- MyAccounts[1] := TNormalOrSavingAccount.Create;
- MyAccounts[1].accountS := TSavingAccount.Create(42,Rate); // saving
- Account.AccountSequenceTest(MyAccounts);
- end;
-
-
- var
- R: Integer;
- begin
- CorbaInitialize;
- {$IFDEF CALLBACK}
- Rate := TRatesSkeleton.Create('Rates', TRates.Create);
- BOA.ObjIsReady(Rate as _Object);
- {$ENDIF}
- write('Rate:');
- readln(R);
- try
- // Add CORBA client Code Here
- {$IFNDEF CALLBACK}
- Rate := TRatesHelper.Bind;
- {$ENDIF}
- Rate.SetRate(R);
- Account := TAccountsHelper.Bind;
-
- write('->');
- readln;
- AccountArrayTest;
- write('+>');
- readln;
- AccountSequenceTest;
- except
- on E: Exception do
- writeln(E.Message)
- end;
- write('=> ');
- readln;
- end.
-
-